import request from '@/api/request';
import { apiClusterJava } from '@/api/root';

// 是否支付该活动
export const isPay = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/activityOrderOpen/isPay',
    data
  );
};

// 创建活动订单并支付
export const addOrderAndPay = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/activityOrderOpen/addOrderAndPay',
    data
  );
};

// 获取职业测评版本
export const getCareerAssessmentVersion = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/getCareerAssessmentVersion',
    data
  );
};

// 获取用户当前答题状态
export const checkStatus = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/checkStatus',
    data
  );
};

// 开始测评答题
export const start = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/start',
    data
  );
};
// 获取职业测评题目列表
export const questionList = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/questionList',
    data
  );
};

// 用户答题提交答案
export const submitAnswer = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/submitAnswer',
    data
  );
};

// 完成测评答题计算结果
export const calculateResult = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/calculateResult',
    data
  );
};

// 获取职业测评结果
export const getCareerAssessmentData = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/getCareerAssessmentData',
    data
  );
};

// 职业测评 支付并解锁测评结果
export const careerAssessPayAndUnlock = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/payAndUnlock',
    data
  );
};

//职业测评产品详情 获取价格及优惠券
export const getProductDetail = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/careerAssessmentOpen/getProductDetail',
    data
  );
};
